package com.woniuxy.mini;

import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.exception.UploadFileException;
import com.woniuxy.config.AliChatService;
import com.woniuxy.entity.UploadResult;
import com.woniuxy.feign.OSSApi;
import com.woniuxy.util.ResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;

@RestController
@RequestMapping("audio")
public class AudioController {
    @Autowired
    AliChatService aliChatService;
    @Autowired
    private OSSApi ossApi;
    @GetMapping("/getAudio")
    public ResponseData getText(@RequestParam(value = "filePath") String filePath) throws NoApiKeyException, UploadFileException {
        System.out.println(filePath);
        String s = aliChatService.simpleMultiModalConversationCall(filePath);
        return ResponseData.ok(s);
    }
}
